<template>
  <fragment>
    <template v-for="(item, index) in navlist">
      <el-submenu v-if="item.children" :key="index" :index="item.url">
        <template slot="title">
          <i :class="item.icon"></i>
          <span>{{ item.name }}</span>
        </template>
        <NavMenu :navlist="item.children"></NavMenu>
      </el-submenu>
      <el-menu-item v-else :index="item.url" :key="index">
        <i :class="item.icon" :title="item.name"></i>
        <span>{{ item.name }}</span>
      </el-menu-item>
    </template>
  </fragment>
</template>

<script>
export default {
  name: "NavMenu",
  props: {
    navlist: Array
  },
  data() {
    return {};
  },
  methods: {},
  mounted() { }
};
</script>

<style lang="stylus" scoped>
.el-menu-item {
  font-size: 0.14rem;
}
</style>
